package com.wx.listener;

import com.wx.bean.People;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class MyApplicationListener implements ApplicationListener<ApplicationEvent> {
	@Override
	public void onApplicationEvent(ApplicationEvent event) {
		System.out.println("收到了一个事件: " + event);
	}

	/**
	 * 注意: 当一个 class 被 @Component | @Controller | @Service | @Repository 注解，
	 * 那么这个类可以被当做配置类 (@Configuration) 来进行解析
	 */
//	@Bean
//	public People people2() {
//		return new People();
//	}
}
